<template>
  <el-select placeholder="请选择" v-bind="$attrs" v-on="$listeners">
    <el-option
      v-for="item in list"
      :key="item.id"
      :value="item.code"
      :label="item.name"
    />
  </el-select>
</template>
<script>
import { getComListApi } from '@/api/bjd/adv'
export default {
  name: 'SelectAdvPos',
  data() {
    return {
      list: []
    }
  },
  created() {
    // this.$attrs 是只没有被props声明的自定义属性
    // this.$listeners 是组件上面所有的事件
    // console.log(this.$attrs)
    // console.log(this.$listeners)
    this.initData()
  },
  methods: {
    async initData() {
      const res = await getComListApi()
      //   console.log(res)
      this.list = res.data
      console.log(this.list)
    //   console.log(this.list)
    }
  }
}
</script>
<style lang="scss" scoped>
</style>
